package cn.aloxc.tianya.reader;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class Activity_test_hunhelayout extends Activity{
	TextView tv = null;
	Button right_btn = null;
	OnClickListener listener = null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout layoutMain = new LinearLayout(this);
        layoutMain.setOrientation(LinearLayout.HORIZONTAL);
        setContentView(layoutMain);
        LayoutInflater inflate = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        RelativeLayout layoutleft = (RelativeLayout)inflate.inflate(R.layout.activity_test_hunhe_left, null);
        RelativeLayout layoutright = (RelativeLayout)inflate.inflate(R.layout.activity_test_hunhe_right, null);
        RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(
        		RelativeLayout.LayoutParams.WRAP_CONTENT,
        		RelativeLayout.LayoutParams.WRAP_CONTENT);
        layoutMain.addView(layoutleft,100,100);
        layoutMain.addView(layoutright,param);
        Bundle data = this.getIntent().getExtras();
        setTitle(data.getString("testItem"));
        
        listener = new OnClickListener(){
			public void onClick(View v) {
				Activity_test_hunhelayout.this.finish();
			}
		};
		tv = (TextView)findViewById(R.id.right_view1);
		tv.setOnClickListener(listener);
		right_btn = (Button)findViewById(R.id.right_button);
		right_btn.setOnClickListener(listener);
    }
}
